package com.shao.im.controller;


import com.shao.commons.aspect.annotation.GetUser;
import com.shao.commons.domain.R;
import com.shao.commons.utils.AuthUtils;
import com.shao.im.entity.vo.FriendsListVo;
import com.shao.im.service.FriendsRelationsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 好友关系表(FriendsRelations)表控制层
 *
 * @author makejava
 * @since 2023-07-28 16:59:40
 */
@RestController
@RequestMapping("/friendsRelations")
@Slf4j
public class FriendsRelationsController {
    /**
     * 服务对象
     */
    @Autowired
    private FriendsRelationsService friendsRelationsService;

    @GetUser
    @RequestMapping("/queryList")
    public R queryFriendsList(){
        Integer uid = AuthUtils.get();
        List<FriendsListVo> friendsList = friendsRelationsService.queryFriendsList(uid);
        //log.debug("[friends list] 好友列表 - {}", friendsList);
        return R.success(friendsList);
    }
}

